#include <wx/frame.h>
#include <wx/button.h>
#include <wx/slider.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/filepicker.h>
#include <wx/spinctrl.h>
#include <wx/progdlg.h>
#include <wx/timer.h>
#include <fstream>
#include "../src/StrmBMP.h"
#include "Display.h"
#include "CameraDriver.h"
#include "../src/Exception_Define.h"

class PreviewFrame : public wxFrame
{
public:
	PreviewFrame(wxWindow* parent,std::list<CameraDevice>::iterator ptr,VideoClipInfo vinfo);
	
private:
	std::list<CameraDevice>::iterator ptrCameraDevice;
	VideoClipInfo videoInfo;

	Display* display;
	wxSlider* playSlider;
	wxStaticText* FrameInf;
	wxSpinCtrl* OutputFirstFrame;
	wxSpinCtrl* OutputLastFrame;
	wxSpinCtrl* OutputStepFrame;
	wxButton* btnOutput;
	wxButton* btnPlayControl;
	wxFilePickerCtrl* dirpOutputDir;

	wxTimer* playTimer;

	void onClose(wxCloseEvent& event);
	void on_playSlider_change(wxScrollEvent& event);
	void on_btnPlayControl_click(wxCommandEvent& event);
	void on_playTimer_timeout(wxTimerEvent& event);
	void on_btnOutput_click(wxCommandEvent& event);
};

enum class PreviewID
{
	playSlider=50,
	FrameInf,
	OutputFirstFrame,
	OutputLastFrame,
	btnOutput,
	btnPlayControl,
	dirpOutputDir,
	playTimer,
	OutputStepFrame
};